<?php
declare (strict_types = 1);

namespace app\common\model;

use think\Model;
use think\model\concern\SoftDelete;
class ChoujiangLog extends Model
{
    use SoftDelete;
     protected $deleteTime = "delete_time";
    // 获取列表
    public static function getList()
    {
        $where = [];
        $limit = input('get.limit');
        
               //按发送人id查找
               if ($senduserid = input("senduserid")) {
                   $where[] = ["senduserid", "like", "%" . $senduserid . "%"];
               }
               //按发送人名称查找
               if ($sendusername = input("sendusername")) {
                   $where[] = ["sendusername", "like", "%" . $sendusername . "%"];
               }
               //按发送日志查找
               if ($sendlog = input("sendlog")) {
                   $where[] = ["sendlog", "like", "%" . $sendlog . "%"];
               }
        $list = self::order('id','desc')->where($where)->paginate($limit);
        return ['code'=>0,'data'=>$list->items(),'extend'=>['count' => $list->total(), 'limit' => $limit]];
    }
}
